USE [CTEM-DB-v1]
GO

/****** Object:  StoredProcedure [dbo].[Employee_GetAdvanceForEmployeeByType]    Script Date: 02/10/2012 11:25:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		GIANGPNT
-- Create date: 24/10/2011
-- Description:	
-- =============================================
CREATE PROCEDURE [dbo].[Employee_GetAdvanceForEmployeeByType] 
	@Type		NVARCHAR(50),
	@EmployeeID bigint
	
AS
BEGIN
	SELECT	A.*, E.Username, E.FullName
	FROM	Advance A JOIN Employee E ON A.EmployeeID = E.EmployeeID
	WHERE	(A.Type LIKE N'%' + @Type + '%') and (A.EmployeeID = @EmployeeID)
END

GO

